<div class="editions bibliotheque">
	<div class="actions_horizontal" style="float:right;margin-right:550px;margin-top:10px;"><?php echo $this->Html->link('Ajouter des livres',array('controller' => 'editions', 'action' => 'add_multiple'),array('class'=>'actions_horizontal')); ?></div>
	<h1><?php echo __('Ma bibliothèque'); ?></h1>
	<table>
	<thead>
	<tr>
			<th></th>
			<th><?php echo $this->Paginator->sort('livre_id'); ?></th>
			<th><?php echo $this->Paginator->sort('date'); ?></th>
			<th><?php echo $this->Paginator->sort('editeur_id'); ?></th>
			<th>Auteur</th>
			<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	</thead>
	<tbody>
	<?php foreach ($editions as $edition): ?>
	<tr>
		<td><?php echo $this->Html->image("livres/".$edition['Edition']['image'], array(
				"alt" => "Couverture de ".$edition['Livre']['titre'],
				"class" => "thumbnail",
				)); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($edition['Livre']['titre'], array('controller' => 'editions', 'action' => 'view', $edition['Edition']['id'])); ?>
		</td>
		<td><?php echo h($edition['Edition']['date']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($edition['Editeur']['nom'], array('controller' => 'editeurs', 'action' => 'view', $edition['Editeur']['id'])); ?>
		</td>
		<td><?php 
			$auteurs = $edition['Livre']['Auteur'];
			$liens = array() ;
			foreach($auteurs as $auteur){
				$liens[] = $this->Html->link($auteur['prenom_nom'], array('controller' => 'editions', 'action' => 'index_auteur', $auteur['id'])); 
			}
			echo join(', ',$liens);
			?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Voir'), array('action' => 'view', $edition['Edition']['id'])); ?>
			<?php echo $this->Html->link(__('Editer'), array('action' => 'edit', $edition['Edition']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</tbody>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} sur {:pages}, enregistrement {:current} sur un total de {:count}, amorce sur le n° {:start}, finissant sur le  n° {:end}')
	));
	?>	</p>
	<div class="paging">
	<?php
		echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
		echo $this->Paginator->numbers(array('separator' => ''));
		echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
	?>
	</div>
	<?php echo $this->Html->link('Ajouter des livres',array('controller' => 'editions', 'action' => 'add_multiple')); ?>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Ajouter des livres'), array('action' => 'add_multiple')); ?></li>
		<li><?php echo $this->Html->link(__('Ma bibliothèque'), array('action' => 'user_index')); ?> </li>
	</ul>
</div>
